<template>
	<div class="main" v-wechat-title="$route.meta.title='尊敬的'+lawyerData.name+'欢迎您'">
		<!--封面开始-->
		<div class="banner"><img src="@/assets/images/wechat/lawyer/lawyercenter/admincenter_banner.jpg"></div>
		<!--封面结束-->
		<!--管理员信息开始-->
		<div class="admininfo">
			<div class="admininfo_top">
				<div class="admininfo_top_avatar">
					<img v-if="lawyerData.avatar" :src="baseUrl+'/static/upload/lawyer/'+lawyerData.avatar">
				</div>
				<div class="admininfo_top_message">
					<div>{{lawyerData.name}}</div>
					<ul>
						<li v-for="(item,index) in lawyerData.tag" :key="index">{{item}}</li>
					</ul>
				</div>
			</div>
			<ul class="admininfo_bottom">
				<li>
					<router-link :to="{path:'consultlist'}">
						<p>{{lawyerData.consultNumber}}</p>
						<div>咨询次数</div>
					</router-link>
				</li>
				<li>
					<a href="javascript:;">
						<p>{{lawyerData.consultScore}}</p>
						<div>评分</div>
					</a>
				</li>
				<li>
					<a href="javascript:;">
						<p>0.00</p>
						<div>赏金</div>
					</a>
				</li>
				<li>
					<a href="javascript:;">
						<p v-if="lawyerData.status==1">在线</p>
						<p v-else-if="lawyerData.status==2">忙碌</p>
						<p v-else-if="lawyerData.status==3">值班</p>
						<p v-else>离线</p>
						<div>状态</div>
					</a>
				</li>
			</ul>
		</div>
		<!--管理员信息结束-->
		<!--菜单开始-->
		<div class="menu">
			<ul>
				<li>
					<router-link :to="{path:'reportList'}">
						<img src="@/assets/images/wechat/lawyer/lawyercenter/index_menu_develop.png">
						<div>领导专线</div>
					</router-link>
				</li>
				<li>
					<a href="javascript:;">
						<img src="@/assets/images/wechat/lawyer/lawyercenter/index_menu_develop.png">
						<div>待开发</div>
					</a>
				</li>
				<li>
					<a href="javascript:;">
						<img src="@/assets/images/wechat/lawyer/lawyercenter/index_menu_develop.png">
						<div>待开发</div>
					</a>
				</li>
				<li>
					<a href="javascript:;">
						<img src="@/assets/images/wechat/lawyer/lawyercenter/index_menu_develop.png">
						<div>待开发</div>
					</a>
				</li>
				<li>
					<a href="javascript:;">
						<img src="../../../../assets/images/wechat/lawyer/lawyercenter/index_menu_develop.png">
						<div>待开发</div>
					</a>
				</li>
				<li>
					<a href="javascript:;">
						<img src="../../../../assets/images/wechat/lawyer/lawyercenter/index_menu_develop.png">
						<div>待开发</div>
					</a>
				</li>
				<li>
					<a href="javascript:;">
						<img src="../../../../assets/images/wechat/lawyer/lawyercenter/index_menu_develop.png">
						<div>待开发</div>
					</a>
				</li>
				<li>
					<a href="javascript:;">
						<img src="../../../../assets/images/wechat/lawyer/lawyercenter/index_menu_develop.png">
						<div>待开发</div>
					</a>
				</li>
			</ul>
		</div>
		<!--菜单结束-->
		<!--导航功能-->
		<div class="link">
			<ul>
				<li>
					<a @click="auth()" href="javascript:;">
						<div>
							<img src="../../../../assets/images/wechat/lawyer/lawyercenter/admincenter_auth.png">
						</div>
						<div>
							<div class="link_title">微信授权</div>
							<div class="link_desc" v-if="lawyerData.wechat==1">查看授权信息</div>
							<div class="link_desc" v-else>暂未授权</div>
							<div class="link_img"><img src="../../../../assets/images/wechat/lawyer/lawyercenter/findpassword_choose.png"></div>
						</div>
					</a>
				</li>
				<li>
					<a @click="leave" href="javascript:;">
						<div>
							<img src="../../../../assets/images/wechat/lawyer/lawyercenter/admincenter_leave.png">
						</div>
						<div>
							<div class="link_title">注销登录</div>
							<div class="link_desc"></div>
							<div class="link_img"><img src="../../../../assets/images/wechat/lawyer/lawyercenter/findpassword_choose.png"></div>
						</div>
					</a>
				</li>
				
			</ul>
		</div>
		<!--导航功能-->
	</div>
</template>

<script>
//引入js	
import router from '@/router/index'
import { lawyerFindLawyerById } from '@/api/lawyer'
	
export default {
	components: {
	},
    data(){
		return {
			baseUrl:process.env.VUE_APP_BASE_API,
			appId:"",
			lawyerData:{}
		}
    },
    created:async function(){
		this.appId=this.$store.state.globalData.wechatConfig.appId
		var ajaxData = {}
		var resultData =await lawyerFindLawyerById(ajaxData)
		if(resultData.code==200){
		   this.lawyerData=resultData.data;
		   this.lawyerData.tag=JSON.parse(this.lawyerData.tag);
		}else{
		   router.push({path:'/wechat/lawyerlogin'});
		   return 0;
		}
  	},
  	beforeMount: function() {
		
    },
  	mounted: function () {
  		
  	},
  	methods:{
  		leave:function(){
			localStorage.clear();
			this.$store.commit("setToken",'');
			router.replace({path:"/wechat/lawyerlogin"});
		},
		auth:function(){
			window.location="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+this.appId+"&redirect_uri="+encodeURIComponent("https://www.lawguanjia.com/#/wechatlawyer/authorizeinfo")+"&response_type=code&scope=snsapi_userinfo#wechat_redirect";
		}
  	}
}
</script>

<style lang="scss" scoped>
.main{ width:100%;overflow:hidden; background:#f5f4f6; position: relative}
.banner{ width:100%; height:200px; overflow:hidden}
.banner>img{ width:100%;}
.admininfo{ width:96%; position:absolute; left:2%; top:150px; background:#FFF;}
.admininfo_top{ width:100%; margin-top:10px; overflow:hidden;}
.admininfo_top_avatar{ width:50px; height:50px; overflow:hidden; float:left; margin-left:10px; border-radius:50%;}
.admininfo_top_avatar>img{ width:100%}
.admininfo_top_message{ width:250px; float:left; margin-left:10px}
.admininfo_top_message>div{ line-height:26px; color:#5f5e63; font-size:16px;}
.admininfo_top_message>ul{ width:100%; overflow:hidden}
.admininfo_top_message>ul>li{ line-height:24px; float:left; margin-left:4px; padding:0px 6px; background:#dedfe3; color:#9397a5; border-radius:12px; font-size:12px;}
.admininfo_top_message>ul>li:nth-child(1){ margin-left:0 !important}
.admininfo_bottom{width:100%; margin-top:20px; overflow:hidden; display:flex; margin-bottom:10px;}
.admininfo_bottom>li{ width:25%;}
.admininfo_bottom>li>a{ display:block; line-height:20px}
.admininfo_bottom>li>a>p{ text-align:center; color:#565859}
.admininfo_bottom>li>a>div{ text-align:center; color:#949195}

.menu{ width:100%; overflow:hidden; margin-top:90px; background:#FFF}
.menu>ul{width:100%;overflow:hidden; margin-top: 10px; margin-bottom: 10px }
.menu>ul>li{ width:25%;float:left}
.menu>ul>li>a{display:block; overflow: hidden;}
.menu>ul>li>a>img{ width:40px; margin:auto; display:block; margin-top:10px;}
.menu>ul>li>a>div{ text-align:center; color:#949195; line-height:16px; margin-top: 10px; margin-bottom: 10px;font-size: 12px;}

.link{ width:100%; background: #ffffff; margin-top: 10px;}
.link>ul{ width:100%; }
.link>ul>li{ width:100%;}
.link>ul>li>a{ display: block; overflow: hidden;}
.link>ul>li>a>div:nth-child(1){ width: 15%;float: left;height: 42px;}
.link>ul>li>a>div:nth-child(1)>img{ width: 20px;display:block;margin:auto;  margin-top: 11px;}
.link>ul>li>a>div:nth-child(2){ width: 85%;float: left;height: 42px; border-bottom: 1px solid #eaeaea; display: flex}
.link_title{ width: 50%; line-height: 42px; color: #534e54;}
.link_desc{ width: 40%; line-height: 42px; text-align: right; color: #acacac; font-size:12px}
.link_img{ width: 10%;}
.link_img>img{width: 16px;display:block;margin:auto;  margin-top: 13px;}
</style>
